/**
 * Created by sun on 2015/3/12.
 */
package com.jbm;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

public class GDCodeFactory implements ProtocolCodecFactory
{
	private final GDEncoder encoder; // 编码
	private final GDDecoder decoder; // 解码

	public GDCodeFactory(String charset)
	{
		encoder = new GDEncoder(charset);
		decoder = new GDDecoder(charset);
	}

	public ProtocolEncoder getEncoder(IoSession session)
	{
		return encoder;
	}

	public ProtocolDecoder getDecoder(IoSession session)
	{
		return decoder;
	}
}